package com.example.app03.dao;

import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;
import com.example.app03.bean.Category;

@Repository
public interface CategoryDao {
	@Insert("insert into cms_category(id,name,description,no) values(null,#{name},#{description},#{no})")
	void save(Category category);
	//
	@Select("select * from cms_category")
	List<Category> selectAll();
	
	@Update("update cms_category set name = #{name},description = #{description},parent_id = #{parentId} where id = #{id}")
	void update(Category category);
	
	@Select("select * from cms_category where id = #{id}")
	Category selectById(long id);
	
	@Delete("delete from cms_category where id = #{id}")
	void deleteById(long id);
	
	
	
	
}
